Skip to content

Conversation

@gaocegege
Copy link
Contributor

@gaocegege gaocegege commented Mar 10, 2025

FIX #14399

FIX #14170

Skip stop checks in reasoning content. It is based on #14428 . I will rebase after it is merged.

from openai import OpenAI

# Modify OpenAI's API key and API base to use vLLM's API server.
openai_api_key = "EMPTY"
openai_api_base = "http://localhost:8000/v1"

client = OpenAI(
    api_key=openai_api_key,
    base_url=openai_api_base,
)

models = client.models.list()
model = models.data[0].id

# Round 1
messages = [{"role": "user", "content": "9.11 and 9.8, which is greater?"}]
response = client.chat.completions.create(
    model=model,
    messages=messages,
    stop="9.8",
)

reasoning_content = response.choices[0].message.reasoning_content
content = response.choices[0].message.content

print("reasoning_content for Round 1:", reasoning_content)
print("content for Round 1:", content)

Output

reasoning_content for Round 1: To determine which number is greater between 9.11 and 9.8, I'll start by aligning their decimal places.

First, I'll write 9.8 as 9.80 to have the same number of decimal places as 9.11.

Next, I'll compare the whole number parts. Both numbers have 9, so they are equal in that aspect.

Then, I'll compare the tenths place. In 9.80, the tenths digit is 8, while in 9.11, it's 1. Since 8 is greater than 1, 9.80 is greater than 9.11.

Therefore, 9.8 is the greater number.

content for Round 1: 

To determine which number is greater between **9.11** and **

@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added documentation Improvements or additions to documentation frontend structured-output labels Mar 10, 2025
@gaocegege gaocegege changed the title [Reasoning] Skip stop in reasoning content [Frontend] Skip stop in reasoning content Mar 10, 2025
@ComposerKevin
Copy link

Very looking forward to this patch!

@gaocegege
Copy link
Contributor Author

@ComposerKevin This is blocked by several PRs about the reasoning parser. I will try my best.

@ComposerKevin
Copy link

Could you also add an extra body option like reasoning_stop? It could be useful for manually induced thinking. For example, it will be possible to prompt model like If you're unsure about X, write $PAUSE_THINKING$ something like that.

@mergify mergify bot added the tpu Related to Google TPUs label Mar 27, 2025
@mergify
Copy link

mergify bot commented Mar 27, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @gaocegege.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added needs-rebase and removed tpu Related to Google TPUs labels Mar 27, 2025
@mergify mergify bot removed the needs-rebase label Mar 28, 2025
@gaocegege gaocegege marked this pull request as ready for review March 28, 2025 09:05
@gaocegege
Copy link
Contributor Author

@aarnphm Could you please take a look?

@gaocegege
Copy link
Contributor Author

/cc @mgoin

@mergify mergify bot added tpu Related to Google TPUs and removed tpu Related to Google TPUs labels Apr 9, 2025
@mergify
Copy link

mergify bot commented May 13, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @gaocegege.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label May 13, 2025
@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity within 90 days. It will be automatically closed if no further activity occurs within 30 days. Leave a comment if you feel this pull request should remain open. Thank you!

@github-actions github-actions bot added the stale Over 90 days of inactivity label Aug 12, 2025
@mgoin
Copy link
Member

mgoin commented Aug 22, 2025

Hey @gaocegege, would you want to resolve conflicts and get this merged? Sorry for losing track

@gaocegege
Copy link
Contributor Author

Hey, not 100% sure if it matches the design yet. I'll dig into it and catch up.

@github-actions github-actions bot added unstale Recieved activity after being labelled stale and removed stale Over 90 days of inactivity labels Aug 23, 2025
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
@gaocegege
Copy link
Contributor Author

PTAL @mgoin

@gaocegege
Copy link
Contributor Author

cc @chaunceyjiang

Copy link
Collaborator

@chaunceyjiang chaunceyjiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks~

@chaunceyjiang chaunceyjiang added the ready ONLY add when PR is ready to merge/full CI is needed label Sep 12, 2025
@chaunceyjiang chaunceyjiang enabled auto-merge (squash) September 15, 2025 04:00
@chaunceyjiang chaunceyjiang merged commit f4a948f into vllm-project:main Sep 15, 2025
45 checks passed
dsxsteven pushed a commit to dsxsteven/vllm_splitPR that referenced this pull request Sep 15, 2025
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
bbartels pushed a commit to bbartels/vllm that referenced this pull request Sep 15, 2025
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
Signed-off-by: bbartels <benjamin@bartels.dev>
"vllm.llm_engine",
self.observability_config.otlp_traces_endpoint)

# Initialize reasoning parser if reasoning backend is set.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class is a V0 class and is obsolete.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see, thanks for the reminder. Should I delete this part of the code? @njhill

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gaocegege @chaunceyjiang
Just to clarify, is this PR intended only for the V0 engine and not compatible with V1? Do you have any plans to add the same feature to V1?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for letting me know!

FeiDaLI pushed a commit to FeiDaLI/vllm that referenced this pull request Sep 25, 2025
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 10, 2025
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
choprahetarth pushed a commit to Tandemn-Labs/vllm that referenced this pull request Oct 11, 2025
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
xuebwang-amd pushed a commit to xuebwang-amd/vllm that referenced this pull request Oct 24, 2025
Signed-off-by: Ce Gao <cegao@tensorchord.ai>
Co-authored-by: Chauncey <chaunceyjiang@gmail.com>
Signed-off-by: xuebwang-amd <xuebwang@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation frontend ready ONLY add when PR is ready to merge/full CI is needed structured-output unstale Recieved activity after being labelled stale

Projects

Status: Done

7 participants